<div class="modal-dialog">
	<style>
		#selectUrl .modal-body {padding: 10px 15px;}
		#selectUrl .tab-pane {margin-top: 5px; min-height: 350px; max-height: 350px; overflow-y: auto;}
		#selectUrl .page-header {padding: 9px 0; margin-bottom: 8px;}
		#selectUrl .page-header h4 {margin: 0;}
		#selectUrl .btn {margin-bottom: 3px;}
		#selectUrl .modal-dialog {width: 820px;}
		#selectUrl .line {border-bottom: 1px dashed #ddd; color: #999; height: 36px; line-height: 36px;}
		#selectUrl .line .icon {height: 35px; width: 30px; position: relative; float: left;}
		#selectUrl .line .icon.icon-1:before {content: ""; width: 10px; height: 10px; border: 1px dashed #ccc; position: absolute; top: 12px; left: 10px;}
		#selectUrl .line .icon.icon-2 {width: 50px;}
		#selectUrl .line .icon.icon-2:before {content: ""; width: 10px; height: 10px; border-left: 1px dashed #ccc; border-bottom: 1px dashed #ccc; position: absolute; top: 12px; left: 20px;}
		#selectUrl .line .icon.icon-3 {width: 60px;}
		#selectUrl .line .icon.icon-3:before {content: ""; width: 10px; height: 10px; border-left: 1px dashed #ccc; border-bottom: 1px dashed #ccc; position: absolute; top: 12px; left: 30px;}
		#selectUrl .line .btn-sm {float: right; margin-top: 5px; margin-right: 5px; height: 24px; line-height: 24px; padding: 0 10px;}
		#selectUrl .line .text {display: block;}
		#selectUrl .line .label-sm {padding: 2px 5px;}
		#selectUrl .line.good {height: 60px; padding: 4px 0;}
		#selectUrl .line.good .image {height: 50px; width: 50px; border: 1px solid #ccc; float: left;}
		#selectUrl .line.good .image img {height: 100%; width: 100%;}
		#selectUrl .line.good .text {padding-left: 60px; height: 52px;}
		#selectUrl .line.good .text p {padding: 0; margin: 0;}
		#selectUrl .line.good .text .name {font-size: 15px; line-height: 32px; height: 28px;}
		#selectUrl .line.good .text .price {font-size: 12px; line-height: 18px; height: 18px;}
		#selectUrl .line.good .btn-sm {height: 32px; padding: 5px 10px; line-height: 22px; margin-top: 9px;}
		#selectUrl .tip {line-height: 250px; text-align: center;}
		#selectUrl .nav-tabs > li > a {padding: 8px 20px;}
	</style>
    <div class="modal-content">
        <div class="modal-header">
            <button data-dismiss="modal" class="close" type="button">×</button>
            <h4 class="modal-title">选择链接</h4>
        </div>
        <div class="modal-body">
        	<ul class="nav nav-tabs" id="selectUrlTab">
				<li class="active"><a href="#sut_shop">商城</a></li>
				<li class=""><a href="#sut_good">商品</a></li>
				{if $syscate['level']!=-1 && !empty($categorys)}
					<li class=""><a href="#sut_cate">商品分类</a></li>
				{/if}
				<li class=""><a href="#sut_group">商品分组</a></li>
			</ul>
			<div class="tab-content ">
				
				<div class="tab-pane active" id="sut_shop">
					
					<div class="page-header"><h4><i class="fa fa-folder-open-o"></i> 商城页面</h4></div>
					<nav data-href="{php echo mobileUrl(null, null, $full)}" class="btn btn-default btn-sm" title="商城首页">主商城首页</nav>
					<nav data-href="{php echo mobileUrl('newstore', array(), $full)}" class="btn btn-default btn-sm" title="商城首页">店铺首页</nav>
					<nav data-href="{php echo mobileUrl('shop/category', array(), $full)}" class="btn btn-default btn-sm" title="分类导航">分类导航</nav>
					<nav data-href="{php echo mobileUrl('goods', array(), $full)}" class="btn btn-default btn-sm" title="全部商品">全部商品</nav>
					<nav data-href="{php echo mobileUrl('shop/notice', array(), $full)}" class="btn btn-default btn-sm" title="公告页面">公告页面</nav>
					<nav data-href="{php echo mobileUrl('member/cart', array(), $full)}" class="btn btn-default btn-sm" title="购物车">购物车</nav>

					<div class="page-header"><h4><i class="fa fa-folder-open-o"></i> 商品属性</h4></div>
					<nav data-href="{php echo mobileUrl(goods, array('isrecommand'=>1, ), $full)}" class="btn btn-default btn-sm" title="推荐商品">推荐商品</nav>
					<nav data-href="{php echo mobileUrl(goods, array('isnew'=>1, ), $full)}" class="btn btn-default btn-sm" title="新品上市">新品上市</nav>
					<nav data-href="{php echo mobileUrl(goods, array('ishot'=>1, ), $full)}" class="btn btn-default btn-sm" title="热卖商品">热卖商品</nav>
					<nav data-href="{php echo mobileUrl(goods, array('isdiscount'=>1, ), $full)}" class="btn btn-default btn-sm" title="促销商品">促销商品</nav>
					<nav data-href="{php echo mobileUrl(goods, array('issendfree'=>1, ), $full)}" class="btn btn-default btn-sm" title="卖家包邮">卖家包邮</nav>
					<nav data-href="{php echo mobileUrl(goods, array('istime'=>1, ), $full)}" class="btn btn-default btn-sm" title="显示抢购">限时抢购</nav>

					<div class="page-header"><h4><i class="fa fa-folder-open-o"></i> 会员中心</h4></div>
					<nav data-href="{php echo mobileUrl('member', array(), $full)}" class="btn btn-default btn-sm" title="会员中心">会员中心</nav>
					<nav data-href="{php echo mobileUrl('order', array(), $full)}" class="btn btn-default btn-sm" title="我的订单(全部)">我的订单(全部)</nav>
					<nav data-href="{php echo mobileUrl('order', array('status'=>0, ), $full)}" class="btn btn-default btn-sm" title="待付款订单">待付款订单</nav>
					<nav data-href="{php echo mobileUrl('order', array('status'=>1, ), $full)}" class="btn btn-default btn-sm" title="待发货订单">待发货订单</nav>
					<nav data-href="{php echo mobileUrl('order', array('status'=>2, ), $full)}" class="btn btn-default btn-sm" title="待收货订单">待收货订单</nav>
					<nav data-href="{php echo mobileUrl('order', array('status'=>4, ), $full)}" class="btn btn-default btn-sm" title="退换货订单">退换货订单</nav>
					<nav data-href="{php echo mobileUrl('order', array('status'=>3, ), $full)}" class="btn btn-default btn-sm" title="已完成订单">已完成订单</nav>
					<nav data-href="{php echo mobileUrl('member/favorite', array(), $full)}" class="btn btn-default btn-sm" title="我的收藏">我的收藏</nav>
					<nav data-href="{php echo mobileUrl('member/history', array(), $full)}" class="btn btn-default btn-sm" title="我的足迹">我的足迹</nav>
					<nav data-href="{php echo mobileUrl('member/recharge', array(), $full)}" class="btn btn-default btn-sm" title="会员充值">会员充值</nav>
					<nav data-href="{php echo mobileUrl('member/log', array(), $full)}" class="btn btn-default btn-sm" title="余额明细">余额明细</nav>
					<nav data-href="{php echo mobileUrl('member/withdraw', array(), $full)}" class="btn btn-default btn-sm" title="余额提现">余额提现</nav>
					<nav data-href="{php echo mobileUrl('member/address', array(), $full)}" class="btn btn-default btn-sm" title="收货地址">收货地址</nav>
					<nav data-href="{php echo mobileUrl('member/info', array(), $full)}" class="btn btn-default btn-sm" title="我的资料">我的资料</nav>
					<nav data-href="{php echo mobileUrl('member/rank', array(), $full)}" class="btn btn-default btn-sm" title="积分排行">积分排行</nav>
					<nav data-href="{php echo mobileUrl('member/rank/order_rank', array(), $full)}" class="btn btn-default btn-sm" title="消费排行">消费排行</nav>
					<!--<nav data-href="{php echo mobileUrl('member/notice', array(), $full)}" class="btn btn-default btn-sm" title="消息提醒设置">消息提醒设置</nav>-->
					<nav data-href="{php echo mobileUrl('member/address', array(), $full)}" class="btn btn-default btn-sm" title="收货地址管理">收货地址管理</nav>

					{if p('commission')}
						<div class="page-header"><h4><i class="fa fa-folder-open-o"></i> {php echo m('plugin')->getName('commission')}</h4></div>
						<nav data-href="{php echo mobileUrl('commission', array(), $full)}" class="btn btn-default btn-sm" title="分销中心">分销中心</nav>
						<nav data-href="{php echo mobileUrl('commission/register', array(), $full)}" class="btn btn-default btn-sm" title="成为分销商">成为分销商</nav>
						<nav data-href="{php echo mobileUrl('commission/myshop', array(), $full)}" class="btn btn-default btn-sm" title="我的小店">我的小店</nav>
					{/if}

					<div class="page-header"><h4><i class="fa fa-folder-open-o"></i> 超级券</h4></div>
					<nav data-href="{php echo mobileUrl('sale/coupon', array(), $full)}" class="btn btn-default btn-sm" title="领取优惠券">领取优惠券</nav>
					<nav data-href="{php echo mobileUrl('sale/coupon/my', array(), $full)}" class="btn btn-default btn-sm" title="我的优惠券">我的优惠券</nav>

				</div>
				
				<div class="tab-pane" id="sut_good">
					<div class="input-group">
						<input type="text" placeholder="请输入商品名称进行搜索" id="select-good-kw" value="" class="form-control">
							<span class="input-group-addon btn btn-default select-btn" data-type="good">搜索</span>
					</div>
					<div id="select-good-list"></div>
				</div>
				
				<div class="tab-pane" id="sut_cate">
					{loop $categorys $category}
						 {if empty($category['parentid'])}
							<div class="line">
								<div class="icon icon-1"></div>
								<nav title="选择" class="btn btn-default btn-sm" data-href="{php echo mobileUrl('goods',array('cate'=>$category['id']), $full)}">选择</nav>
								<div class="text">{$category['name']}</div>
							</div>
							 {loop $categorys $category2}
							 	{if $category2['parentid']==$category['id']}
								 	<div class="line">
										<div class="icon icon-2"></div>
										<nav title="选择" class="btn btn-default btn-sm" data-href="{php echo mobileUrl('goods',array('cate'=>$category2['id']), $full)}">选择</nav>
										<div class="text">{$category2['name']}</div>
									</div>
									{loop $categorys $category3}
										 {if $category3['parentid']==$category2['id']}
											 <div class="line">
												<div class="icon icon-3"></div>
												<nav title="选择" class="btn btn-default btn-sm" data-href="{php echo mobileUrl('goods',array('cate'=>$category3['id']), $full)}">选择</nav>
												<div class="text">{$category3['name']}</div>
											</div>
										 {/if}
									{/loop}
							 	{/if}
							 {/loop}
						{/if}
					{/loop}
				</div>

				<div class="tab-pane" id="sut_group">
					{loop $goodsgroup $gg}
						<div class="line">
							<div class="icon icon-group"></div>
							<nav title="选择" class="btn btn-default btn-sm" data-href="{php echo mobileUrl('newstore/goods/list', array('groupid'=>$gg['id']))}">选择</nav>
							<div class="text">{$gg['name']}</div>
						</div>
					{/loop}
				</div>

			</div>
        </div>
        <div class="modal-footer">
            <button data-dismiss="modal" class="btn btn-default" type="button">关闭</button>
        </div>
        <script>
        	$(function(){
        		$("#selectUrl").find('#selectUrlTab a').click(function(e) {
						$('#tab').val($(this).attr('href'));
						e.preventDefault();
						$(this).tab('show');
				});
        		$(".select-btn").click(function(){
        			var type = $(this).data("type");
        			var kw = $.trim($("#select-"+type+"-kw").val());
        			if(!kw){
        				tip.msgbox.err("请输入搜索关键字！");
        				return;
        			}
        			$("#select-"+type+"-list").html('<div class="tip">正在进行搜索...</div>');
        			$.ajax("{php echo webUrl('store/diypage/selecturl/query', array('full'=>$full))}", {
		      			type: "get",
		      			dataType: "html",
		      			cache: false,
		      			data: {kw:kw, type:type}
		      		}).done(function (html) {
		      			$("#select-"+type+"-list").html(html);
		      		});
        		});
        	});
        </script>
    </div>

 